package   notYetUsed
{
	import org.flixel.*;
	import org.flixel.plugin.photonstorm.*;
	
	public class PauseMenu extends FlxGroup {
		
		public function PauseMenu(mainTile:String = null) {
			
			var mainTile:String = (mainTile) ? mainTile : '';
			var mainTitle_txt:FlxText = new FlxText( 10 , 20, FlxG.width, mainTile);
			mainTitle_txt.color = FlxG.WHITE;
			mainTitle_txt.size = 60;
			mainTitle_txt.shadow = 0xffaaaaaa;
			
			var subTitle_txt:FlxText = new FlxText( FlxG.width / 2 + 50, 100, 150);
			subTitle_txt.size = 12 ;
			subTitle_txt.color = FlxG.WHITE;
			subTitle_txt.shadow = 0xffaaaaaa;
			
			var startButton:FlxButton;
			if(mainTile != 'PAUSE') startButton = new FlxButton( FlxG.width / 2 - 75, 150, 'START GAME', startGame);
			else startButton = new FlxButton( FlxG.width / 2 - 75, 150, "RESUME GAME", resumeGame);
			
			var loadButton:FlxButton 	= new FlxButton( FlxG.width / 2 - 75, 200,"Load Game", loadGame);
			var saveButton:FlxButton 	= new FlxButton( FlxG.width / 2 - 75, 220,"Save Game", saveGame);
			var creditButton:FlxButton 	= new FlxButton( FlxG.width / 2 - 75, 250,"Show Credit", showCredit);
			
			//startButton.label.height =  loadButton.label.height = saveButton.label.height = saveButton.label.height = creditButton.label.height = 100; 
			
			var shape:FlxSprite = new FlxSprite();
			shape.makeGraphic(FlxG.width, FlxG.height, 0x88000000);
			
			add(shape);
			add(mainTitle_txt);
			add(subTitle_txt);
			add(startButton);
			add(loadButton);
			add(saveButton);
			add(creditButton);
			
			setAll("scrollFactor", new FlxPoint(0, 0));
			
		}
		
		private function resumeGame():void{
			FlxG.paused = false;
			this.alive = false;
			this.exists = false;
			
			//kill();
			return;
		}
		private function loadGame(saveName:FlxSave=null):void {
			
		}
		private function choseLoad():void {
			
		}
		
		private function lastSave():void {
			//var lastSave:FlxSave = new FlxSave();
			//loadGame(lastSave);
		}
		
		private function showCredit():void {
			//var movieclip:MovieClip = new MC_Smiley();
			//var fmc:FlxMovieClip = new FlxMovieClip();
			//fmc.loadMovieClip(movieclip, 400, 300);
			//add(fmc);
		}
		
		private function saveGame():void {
			// Simple use of flixel save game object
			var save:FlxSave = new FlxSave();
			if (save.bind("Mode"))
			{
				if (save.data.plays == null)
					save.data.plays = 0;
				else
					save.data.plays++;
				FlxG.log("Number of plays: " + save.data.plays);
			}
		}
		
		private function startGame():void {
			// use subState for the pause menu
			//FlxG.switchState(new PlayState);
		}
		
	}

}